package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.JhjsTwoMapper;
import com.ruoyi.control.domain.JhjsTwo;
import com.ruoyi.control.service.IJhjsTwoService;

/**
 * 11402机巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class JhjsTwoServiceImpl extends ServiceImpl<JhjsTwoMapper, JhjsTwo> implements IJhjsTwoService //修改
{
    @Autowired
    private JhjsTwoMapper jhjsTwoMapper;

    /**
     * 查询11402机巷局扇
     * 
     * @param tagName 11402机巷局扇主键
     * @return 11402机巷局扇
     */
    @Override
    public JhjsTwo selectJhjsTwoByTagName(String tagName)
    {
        return jhjsTwoMapper.selectJhjsTwoByTagName(tagName);
    }

    /**
     * 查询11402机巷局扇列表
     * 
     * @param jhjsTwo 11402机巷局扇
     * @return 11402机巷局扇
     */
    @Override
    public List<JhjsTwo> selectJhjsTwoList(JhjsTwo jhjsTwo)
    {
        return jhjsTwoMapper.selectJhjsTwoList(jhjsTwo);
    }

    /**
     * 新增11402机巷局扇
     * 
     * @param jhjsTwo 11402机巷局扇
     * @return 结果
     */
    @Override
    public int insertJhjsTwo(JhjsTwo jhjsTwo)
    {
        return jhjsTwoMapper.insertJhjsTwo(jhjsTwo);
    }

    /**
     * 修改11402机巷局扇
     * 
     * @param jhjsTwo 11402机巷局扇
     * @return 结果
     */
    @Override
    public int updateJhjsTwo(JhjsTwo jhjsTwo)
    {
        jhjsTwo.setUpdateTime(DateUtils.getNowDate());
        return jhjsTwoMapper.updateJhjsTwo(jhjsTwo);
    }

    /**
     * 批量删除11402机巷局扇
     * 
     * @param tagNames 需要删除的11402机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsTwoByTagNames(String[] tagNames)
    {
        return jhjsTwoMapper.deleteJhjsTwoByTagNames(tagNames);
    }

    /**
     * 删除11402机巷局扇信息
     * 
     * @param tagName 11402机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsTwoByTagName(String tagName)
    {
        return jhjsTwoMapper.deleteJhjsTwoByTagName(tagName);
    }

    @Override
    public List<JhjsTwo> getList() {
        List<JhjsTwo> jhjsTwoList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            JhjsTwo jhjsTwo = jhjsTwoMapper.selectJhjsTwoByTagName(fanDatum);
            jhjsTwoList.add(jhjsTwo);
        }
        return jhjsTwoList;
    }
}
